<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ include file="../include/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<title>菜单信息</title>
  	<%@ include file="../include/jsCss.jsp" %>
<script>
	function deleteMenu(id) {
		var dt = new Date();
		 $.ajax({
	           type: "POST",
	           url: "menu!menuDelete.html", 
	           data: "menuId="+id+"&date="+dt,
	           success: function(data)
	           {
	           		if ($.trim(data) == 'success') {
	           			alert('删除成功');
	           			document.location.reload();//重新加载
	           		}
	           }
	    });
	}
</script>

</head>

<body>
	<form action="menu!menuList.html" method="post">
			<table border="1" width="110%">
				<tr>
					<th colspan="13"><h2>菜单信息</h2>
					</th>
				</tr>
				<tr>
					<td style="border:0px;" colspan="2">菜单名称：</td>
					<td style="border:0px;"><input type="text" name="menuName"/></td> 
					<td style="border:0px;"><input type="submit" value="搜索" /></td>
					<td  colspan="10" style="border:0px;text-align:right;padding-right:20px;">
					 	<a href="menu!menuAdd.html">添加菜单信息</a>
					</td>
				</tr>
				<tr> 
					<td>菜单ID</td>
					<td>菜单名称</td>
					<td>排序</td>
					<td>上级ID</td> 
					<td>菜单URL</td> 
					<td>状态</td>
					<td>修改人</td>
					<td>修改时间</td>
					<td>操作</td>
				</tr>
				
				<s:iterator value="menuList" status="status">
					<tr> 
						<td>
							<s:property value="#status.index+1"/>
						</td>
						<td><s:property value="menuName" />
						</td>
						<td><s:property value="menuOrder" />
						</td>
						<td><s:property value="parentId" />
						</td> 
						<td><s:property value="menuUrl" />
						</td> 
						<td>
							 <s:if test="status == 0">有效 </s:if>
						 	 <s:if test="status == 1">无效</s:if>
						</td>
						<td><s:property value="modifyUser" />
						</td>
						<td><s:property value="modifyDate" />
						</td>
						<td>
							<a href="menu!menuUpdate.html?menuId=<s:property value="menuId"/>">修改 </a> |
							<a href="javascript:deleteMenu(<s:property value="menuId"/>)">删除</a>
						</td>
					</tr>
				</s:iterator>
			</table>
			<div>
				<jsp:include page="../include/page.jsp"></jsp:include> 
			</div>
	</form>
</body>
</html>